<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Guarantee extends CI_Controller {
	
	function index($id){
		$id = intval($id);
		if($id>0){
			
			$this->load->model('Borrow_model', 'borrow');
			
			$guarantee_info = $this->borrow->get_borrow_guarantee_obj($id);
			if($guarantee_info){
				$this->load->model('Attestation_model', 'attestation');
				$attList = $this->attestation->get_list_guarantee($guarantee_info['id']);
				$vdata['attlist'] = $attList;
				$vdata['guarantee'] = $guarantee_info;
				$vdata['title'] 		= ' 合作金融机构 - '.CON_KEYWORDS;
				$this->load->view('site/guarantee', $vdata);
			}else{
				$this->js->alert("没有此公司");
				$this->js->go("/");
			}
			
		}else{
			$this->js->alert("没有此公司");
			$this->js->go("/");
		}	
		
	}
	
}